#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QMenuBar* menu_bar = new QMenuBar();
    this->setMenuBar(menu_bar);

    QMenu* menu1 = new QMenu("文件(&F)");
//    menu1->grabShortcut(
    QMenu* menu2 = new QMenu("编辑(&E)");
    QMenu* menu3 = new QMenu("关于(&A)");

    menu_bar->addMenu(menu1);
    menu_bar->addMenu(menu2);
    menu_bar->addMenu(menu3);

    QAction* new_file = new QAction("新建(&N)");
    QAction* save = new QAction("保存(&S)");
    QAction* save_as = new QAction("另存为(&A)");
    QAction* quit = new QAction("退出(&Q)");

    menu1->addAction(new_file);
    menu1->addAction(save);
    menu1->addAction(save_as);
    menu1->addAction(quit);
}

MainWindow::~MainWindow()
{
    delete ui;
}

